package com.group6.exam.manager.dao;

import java.util.List;
import java.util.Map;

import com.group6.exam.common.util.DBUtil;

public class UserRoleDaoImpl implements IUserRoleDao {

	@Override
	public List<Map<String, Object>> getRole() {
		return DBUtil.executeQuery("select * from roleinfo");
	}

	@Override
	public String getTRoleNameById(String roleId) {
		List<Map<String, Object>> list = DBUtil.executeQuery(
				"select role_name from roleinfo where role_id=?", roleId);

		return list != null && list.size() > 0 ? list.get(0).get("role_name")
				+ "" : null;
	}

}
